class drive:

    def data(self,*args,**kwargs):
        def c(func):
            def value():
                for j in range(kwargs["number"]):
                    func(str(j+1),str(j))
            return value
        return c
dr=drive()

@dr.data(number=10)
def aaa(number,value):
    print("次数"+number+"   值"+value)
aaa()



#
# import re
# import os
# class Tem:
#     def __init__(self,value):
#         if isinstance(value,str):
#             self.value=value
#         else:
#             raise TypeError("Tem只接受字符串")
#         self.pre=re.compile('(?P<name>\${.*?})')
#     def tem_sub(self,dict_value):
#
#         if isinstance(dict_value,dict):
#             def conver(m):
#                 name=m.group("name")
#                 name=re.findall("[a-z,A-Z,0-9]",name)
#                 try:
#                     return str(dict_value[''.join(name)])
#                 except KeyError:
#                     return m.group()
#             return self.pre.sub(conver,self.value)
#         else:
#             raise TypeError("tem_sub只接受字典")
#
# print(Tem('我想得到token:${token},${aaa}').tem_sub({"token":"这个是你想要的token值","aaa":123}))

#
# class A:
#     def a(self):
#         print("我是a，我被执行了")
# while True:
#     aaa=input("我想执行动作：")
#     if hasattr(A(),aaa):
#         a1=getattr(A(),aaa)
#         a1()
#         break
#     else:
#         print("动作不存在")